import {HttpProvider} from '../../common/http'
import {Injectable} from '@angular/core'
import {API} from '../../common/api'

@Injectable()
export class HomeProvider {

  constructor(public http: HttpProvider) {
    console.log('Hello HomeProvider Provider');
  }

  getIndexInfo() {
    return this.http.requestWithoutToken({
      type: 'GET',
      url: API.NO_LOGIN_LIST
    }).then(data => data).catch(err => {
      this.http.toastMsg(err.code + ':' + err.msg)
    })
  }

  getBanner(){
    return this.http.requestWithoutToken({
      type: 'GET',
      url: API.HOME_BANNER
    }).then(data => data).catch(err => {
      this.http.toastMsg(err.code + ':' + err.msg)
    })
  }

}
